package com.badibadi.activity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.badibadi.adapter.GridViewSHUZHUAdapter;
import com.badibadi.adapter.PinLunGYAdapter;
import com.badibadi.adapter.PinLunGYAdapter.PinLunInterface;
import com.badibadi.adapter.PinLunGYAdapter.PinLunRefreshMsg;
import com.badibadi.infos.BrowseAllPhoto_Model;
import com.badibadi.infos.Discuss;
import com.badibadi.infos.Results;
import com.badibadi.infos.User;
import com.badibadi.infos.User_trends_Model;
import com.badibadi.mytools.CalendarTools;
import com.badibadi.mytools.CommonUtils;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.Dialog;
import com.badibadi.mytools.HtmlUtils;
import com.badibadi.mytools.IOUtils;
import com.badibadi.mytools.JSONUtils;
import com.badibadi.mytools.MyThreadTool;
import com.badibadi.mytools.PopWindowUtils;
import com.badibadi.mytools.ShareSDKTools;
import com.badibadi.mytools.Utils;
import com.badibadi.uniclubber.R;
import com.badibadi.uniclubber.SinaExpressionActivity;
import com.badibadi.uniclubber.R.layout;
import com.badibadi.uniclubber.R.menu;
import com.libjph.util.JsonUtil;
import com.libjph.util.StringUtil;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;

import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.Editable;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

/**
 * 看详细 删除 1. 第一种情况是从主页中直接传过来的 2. trendsId
 * 
 * @author Administrator PinLunGY
 * 
 * @author Administrator getView initTopViewId showTopView initRecordId
 *         RecordDongtai initClubId CreateClubDongtai initUpPictureId
 *         UpPictureDongtai initDongTaiId XinQingDongtai initActivityId
 *         PostActivityDongtai
 */
public class LookAtTheDetailedActivity extends BaseActivity {// drop_down

	private static final String TAG = "AfterLandingMyHomePagePingLunFragment";// holder.share
	private User_trends_Model user_trends;

	public static int gerenbiaoqing = 18;

	int[] layoutId = new int[] { R.layout.chuangjianjulebudongtai,// 创建俱乐部ok
			// logo
			R.layout.fahuodongdongtai,// 发起活动
			R.layout.up_tupiandongtai,// 上传图片
			R.layout.dongtaiaddtupian,// 动态（图片和文字都有）ok
			R.layout.jiludongtai // 记录动态
	};
	private DisplayImageOptions options;
	int type = 0;
	LinearLayout ll;// 主要的ll

	// 评论的资源zanPeople
	Discuss discuss;

	// 赞的所有人
	List<User> user;
	// 用于点赞后
	// private ImageView change_imageView;// 接受view的
	private String ShareImage = null; // 分享的图片
	ViewHolder holder;
	private String cid;// 俱乐部的id
	// 记录收藏项
	// private int pos_=-1;
	// 显示缩起
	private boolean ShowSuoQi = false;
	// **第二种情况
	private String trendsId;
	private Handler handler = new Handler() {
		@Override
		public void handleMessage(Message msg) {

			switch (msg.what) {
			case 1:
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_net_error));
				} catch (Exception e) {
					// TODO: handle exception
				}
				break;
			case 2:
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					if (user != null) {
						holder.all_zan_people.setVisibility(View.VISIBLE);
						initZandeRen();
						// StringBuilder buff=new StringBuilder("");
						//
						// for(int i=0;i<user.size();i++)
						// {
						//
						// // holder.zanPeople.setText();
						// buff.append("、"+user.get(i).getNickName());
						// }
						// String a=buff.substring(1, buff.length());
						// holder.zanPeople.setText(""+a);

					} else {
						holder.all_zan_people.setVisibility(View.GONE);
					}
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			case 3:
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.SystemError));
				} catch (Exception e) {

				}
				break;
			case 4:// 这是评论的
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					// initDissCussView();
					initPinLun();
				} catch (Exception e) {
					// TODO: handle exception
				}
				break;
			case 5:// 点赞成功
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					holder.is_praise.setSelected(true);
					// holder.admire.setText(""
					// + (Integer.parseInt(holder.admire.getText()
					// .toString()) + 1));
					int a = Integer
							.parseInt(user_trends.getAdmire().toString());
					user_trends.setIs_praise("1");
					user_trends.setAdmire("" + (a + 1));
					init0();
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			case 7:// 删除动态成功
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							"删除成功,正在跳转...");
				} catch (Exception e) {

				}
				break;
			case 8:// 删除动态失败
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {

					Utils.showMessage(LookAtTheDetailedActivity.this, "删除失败");
				} catch (Exception e) {

				}
				break;
			case 9://
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {

					Utils.showMessage(LookAtTheDetailedActivity.this, "系统出错");
				} catch (Exception e) {

				}
				break;
			case 10:// 评论成功
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					Utils.showMessage(LookAtTheDetailedActivity.this, "评论成功");
					// Intent intent=new
					// Intent(LookAtTheDetailedActivity.this,LogReadingDanjiActivity.class);
					// // bun.putString("aid", aid);
					// // bun.putInt("position", position);
					// // bun.putString("rid", rid);
					// intent.put("aid", value);
					// intent.put("position",position);
					int a = Integer.parseInt(user_trends.getDiscuss()
							.toString());
					user_trends.setDiscuss("" + (a + 1));
					init0();
					// sd
					// ShowDisscuss(
					// user_trends.getId(),
					// user_trends.getType(),
					// "" + 99999,
					// ""
					// +
					// Dialog.getSystemLanguageTypegy(LookAtTheDetailedActivity.this));

					// int
					// is=Integer.parseInt((holder.discuss.getText().toString()))+1;
					// holder.discuss.setText(""+is);
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			case 11:// 评论成功
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {
					Utils.showMessage(LookAtTheDetailedActivity.this, "评论失败");
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;

			case 12://
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {

					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb79));

					user_trends.setIs_collected(1);
					user_trends
							.setCollect(""
									+ (Integer.parseInt((user_trends
											.getCollect())) + 1));
					holder.is_collected.setSelected(true);
					holder.collect.setText(""
							+ (Integer.parseInt(holder.collect.getText()
									.toString().trim()) + 1));
					// x1Adapter.notifyDataSetChanged();

				} catch (Exception e) {

				}
				break;
			case 13://
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);
				try {

					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb83));
				} catch (Exception e) {

				}
				break;
			case 14://
				Utils.ExitPrgress(LookAtTheDetailedActivity.this);

				try {
					ll.addView(getLayoutView());
					init0();
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			default:
				break;
			}

		}
	};

	// 更新赞的人在界面上
	public void initZandeRen() {
		// TODO Auto-generated method stub
		if (user != null) {
			String zanpeople = "";
			StringBuffer buff = null;
			int zishu = 0;// 统计字数,是为了知道什么地方变色
			for (int i = 0; i < user.size(); i++) {
				// zanPeople
				buff = new StringBuffer("");
				buff.append("、" + user.get(i).getNickName());
				if (i > 10) {
					zishu = buff.length() - 1;
					buff.append(getResources().getString(R.string.l_xb84)
							+ user.size()
							+ getResources().getString(R.string.l_xb85));
					break;
				}
				if (i == user.size() - 1) {
					zishu = buff.length() - 1;
					buff.append(getResources().getString(R.string.l_xb86));
				}
			}
			zanpeople = buff.substring(1, buff.length());
			SpannableStringBuilder style = new SpannableStringBuilder(zanpeople);
			style.setSpan(
					new ForegroundColorSpan(getResources().getColor(
							R.color.gray_445879)), 0, zishu,
					Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
			holder.zanPeople.setText(style);
			// String text = String.format(
			// getResources().getString(R.string.fqcjlcyyjtpx), money);
			// SpannableStringBuilder style = new SpannableStringBuilder(text);
			// // 设置指定位置文字的颜色
			// style.setSpan(new ForegroundColorSpan(Color.BLUE), 10,
			// (10 + ("" + money).length()),
			// Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
			// fqcj.setText(style);
		} else {
			holder.all_zan_people.setVisibility(View.GONE);
		}

	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		goToTheTitle();
		setContentView(R.layout.activity_look_at_the_detailed);
		init();

		if (user_trends != null) {
			ll.addView(getLayoutView());
			init0();

		} else if (user_trends == null) {
			init1();
		}

	}

	/** 第二种情况 只有一個心情動態id */
	private void init1() {
		//
		// TODO Auto-generated method stub
		trendsId = getIntent().getStringExtra("trendsId");
		if (trendsId != null) {
			showTrendsHourm(trendsId);
		}
	}

	private void showTrendsHourm(final String trendsId) {
		MyThreadTool.fixedThreadPool.execute(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				MyThreadTool.fixedThreadPool.execute(new Runnable() {
					@Override
					public void run() {
						Map<String, Object> map = new HashMap<String, Object>();
						map.put("uid",
								Utils.getUid(LookAtTheDetailedActivity.this));
						map.put("trendsId", trendsId);
						String content = null;

						content = Utils.sendRequest(map, Constants.BadiUrl_1
								+ "commonality/showTrendsHourm");
						//
						if (content != null) {
							Results results = Utils.checkResult_NNN(
									LookAtTheDetailedActivity.this, content);

							//

							if (results != null
									&& !results.getRetmsg().equals("null")) {

								try {
									if (results.isRet() == true) {
										user_trends = JSONUtils.getEntityByJsonString(
												results.getRetmsg(),
												User_trends_Model.class);
										handler.sendEmptyMessage(14);
									} else {
										handler.sendEmptyMessage(3);
									}

								} catch (Exception e) {
									// TODO Auto-generated catch block

								}

							} else {

								handler.sendEmptyMessage(3);
							}
						} else {

							handler.sendEmptyMessage(1);
						}
					}
				});
			}
		});
	}

	/*** 配置已经有的 */
	private void init() {
		// TODO Auto-generated method stub
		//
		user_trends = (User_trends_Model) getIntent().getSerializableExtra(
				"User_trends_Model");
		// 是否显示缩起，仅心情动态
		ShowSuoQi = getIntent().getBooleanExtra("ShowSuoQi", false);
		this.findViewById(R.id.return_btn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						finish();
					}
				});
		holder = new ViewHolder();
		options = new DisplayImageOptions.Builder()
				.showStubImage(R.drawable.ic_stub)
				.showImageForEmptyUri(R.drawable.noimage)
				.showImageOnFail(R.drawable.noimage).cacheInMemory()
				.cacheOnDisc().displayer(new RoundedBitmapDisplayer(5)).build();
		ll = (LinearLayout) this.findViewById(R.id.zong_ll);

		// user_trends = (User_trends_Model) IOUtils
	}

	/** 这是第一种情况 從主頁中傳過來 */
	private void init0() {
		// TODO Auto-generated method stub
		// .readSerializedObjectsToSDcard(IOUtils
		// .getSavePinLunObjectPath(LookAtTheDetailedActivity.this));
		cid = user_trends.getClub_id();
		if (cid == null) {
			cid = "0";
		}

		holder.send_content = (EditText) this.findViewById(R.id.send_content);
		holder.send = (Button) this.findViewById(R.id.send);
		holder.zanPeople = (TextView) this.findViewById(R.id.zanPeople);
		holder.all_zan_people = (LinearLayout) this
				.findViewById(R.id.all_zan_people);
		holder.biaoqing = (ImageView) this.findViewById(R.id.biaoqing);

		holder.biaoqing.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(LookAtTheDetailedActivity.this,
						SinaExpressionActivity.class);
				// ((Activity)(LookAtTheDetailedActivity.this))
				startActivityForResult(intent, gerenbiaoqing);
			}
		});

		// initPinLun(view);
		// view.findViewById(R.id.send).setOnClickListener(new
		// View.OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// // TODO Auto-generated method stub
		// sendMessage();
		// }
		// });

		holder.listview_pinlun = (ListView) this
				.findViewById(R.id.listview_pinlun);// 评论的
		//
		showdongtai(holder, type);

		praiseList(getTable(), user_trends.getId());
		// 可以用来刷新评论列表
		ShowDisscuss(
				user_trends.getId(),
				user_trends.getType(),
				"" + 99999,
				""
						+ Dialog.getSystemLanguageTypegy(LookAtTheDetailedActivity.this));
	}

	private void initPinLun() {
		// TODO Auto-generated method stub
		if (discuss != null) {
			// LayoutInflater
			// inflater=LayoutInflater.from(LookAtTheDetailedActivity.this);
			// View view=inflater.inflate(R.layout.pinglun_layout, null);

			PinLunGYAdapter gyAdapter = new PinLunGYAdapter(
					LookAtTheDetailedActivity.this, discuss,
					user_trends.getId(), getTable(), user_trends.getUid(),
					holder.send_content, holder.send);

			gyAdapter.setOnRefreshPingLunInterface(new PinLunInterface() {

				@Override
				public void DeletePingLunRefresh() {
					// TODO Auto-generated method stub
					// ShowDisscuss(
					// user_trends.getId(),
					// user_trends.getType(),
					// "" + 99999,
					// ""
					// +
					// Dialog.getSystemLanguageTypegy(LookAtTheDetailedActivity.this));
					init0();
				}
			});
			gyAdapter.setOnRefreshMsgNum(new PinLunRefreshMsg() {

				@Override
				public void RefreshMsgNum() {
					// TODO Auto-generated method stub
					int a = Integer.parseInt(user_trends.getDiscuss());
					user_trends.setDiscuss("" + (a + 1));

				}
			});

			gyAdapter.setOnRefreshMsgNum_1(new PinLunRefreshMsg() {

				@Override
				public void RefreshMsgNum() {
					// TODO Auto-generated method stub
					int a = Integer.parseInt(user_trends.getDiscuss());
					user_trends.setDiscuss("" + (a - 1));
				}
			});
			holder.listview_pinlun.setAdapter(gyAdapter);
			// ll.addView(view);
			//
		}

	}

	// 被评论类型activity club humor_trends photo photo_img record_article
	private String getTable() {
		if (type == 0) {
			return "activity";
		} else if (type == 1) {
			return "record_article";
		} else if (type == 2) {
			return "photo";
		} else if (type == 3) {
			return "humor_trends";
		} else if (type == 4) {
			return "club";
		}
		return ShareImage;

	}

	/**
	 * 添加主要的视图
	 * 
	 * @return
	 */
	private View getLayoutView() {
		LayoutInflater inflater = LayoutInflater
				.from(LookAtTheDetailedActivity.this);
		View view = null;
		if (user_trends.getType() != null) {
			if (user_trends.getType().equals("activity"))// activity
			{
				view = inflater.inflate(R.layout.fahuodongdongtai, null);
				type = 0;
				return view;
			} else if (user_trends.getType().equals("record"))// activity
			{
				view = inflater.inflate(R.layout.jiludongtai, null);
				type = 1;
				return view;
			}
			if (user_trends.getType().equals("photo"))// activity
			{
				view = inflater.inflate(R.layout.up_tupiandongtai, null);
				type = 2;
				return view;
			}
			if (user_trends.getType().equals("humor_trends"))// activity
			{
				view = inflater.inflate(R.layout.dongtaiaddtupian, null);
				type = 3;
				return view;
			}
			if (user_trends.getType().equals("club"))// activity
			{
				view = inflater.inflate(R.layout.chuangjianjulebudongtai, null);
				type = 4;
				return view;
			}
			// 被评论类型activity club humor_trends photo photo_img record_article
		} else if (user_trends.getTable().equals("humor_trends")) {
			view = inflater.inflate(R.layout.dongtaiaddtupian, null);
			type = 3;
			return view;
		}

		return view;

	}

	/**
	 * 动态
	 * 
	 * @param this
	 */
	private void showdongtai(ViewHolder holder, int type) {

		/**
		 * 创建俱乐部动态
		 */
		if (type == 4) {
			initClubId(holder);
			CreateClubDongtai(holder);
		}
		/**
		 * 发起活动
		 */
		if (type == 0) {
			// try {
			initActivityId(holder);
			PostActivityDongtai(holder);
			// } catch (Exception e) {
			//
			// }
		}
		/**
		 * 上传图片
		 */
		if (type == 2) {
			initUpPictureId(holder);
			UpPictureDongtai(holder);

		}

		/**
		 * 动态（图片和文字都有）
		 * 
		 */
		if (type == 3) {
			//
			// 心情动态
			// try {
			initDongTaiId(holder);
			XinQingDongtai(holder);
			// } catch (Exception e) {
			//
			// }

		}
		/**
		 * 记录动态
		 */
		if (type == 1) {

			RecordDongtai(holder);

		}
	}

	static class ViewHolder {
		public Button send;
		public EditText send_content;
		// 顶部视图
		// one
		public LinearLayout ll_home_page;// 个人主页
		public LinearLayout ll_picture;// 照片
		public LinearLayout ll_record;// 记录
		public LinearLayout ll_club;// 俱乐部
		public LinearLayout ll_activity;// 活动
		// two
		public LinearLayout ll_collect;// 收藏
		public LinearLayout ll_friends;// 朋友
		public LinearLayout ll_data;// 资料
		public LinearLayout ll_otherspace;// 其他空间

		public ImageView left;
		public ImageView right;
		public LinearLayout two_line;
		public LinearLayout two;
		public LinearLayout one_line;
		public LinearLayout one;
		public TextView t_friends;
		public TextView t_activity;
		public TextView t_club;
		public TextView t_record;
		public TextView t_picture;
		public TextView tv_city;
		public TextView tv_nickName;
		public TextView tv_motto;
		public ImageView iv_touxiang;
		public ImageView iv_beijing;
		// 'record' 对应的属性
		// public String type;//类型 用于判断接收返回值是选用的model
		public TextView view;// 浏览次数
		// public String discuss;//评论次数
		// public String collect;//收藏次数
		// public String id;//该记录的id
		// public String time;//记录添加时间
		public ImageView image;// 封面图
		public TextView content;// 记录的内容
		// public String delete_hands;//自己 为删除 别的人 举报
		// public String nickName;//发表信息用户昵称
		// private String head//发表信息用户头像
		// private String uid//发表信息的用户id

		// 'photo' 对应的属性（相册）

		// public String type;//类型 用于判断接收返回值是选用的model
		public TextView time;// 上传时间
		public TextView comment;// 评论
		public TextView reprint;// 获赞
		public TextView img;// 上传的照片路劲和id
		public TextView z_user;// 点赞的人名称和id
		public TextView img_count;// 上传照片的数量
		public TextView photo_name;// 上传到到哪个相册名称
		// public String delete_hands;//自己 为删除 别的人 举报
		// public String nickName;//发表信息用户昵称
		// private String head//发表信息用户头像
		// private String uid//发表信息的用户id
		// public ImageView iv_0;
		// public ImageView iv_1;
		// public ImageView iv_2;
		// public ImageView iv_3;
		// public ImageView iv_4;
		// public ImageView iv_5;
		// public ImageView iv_6;
		// public ImageView iv_7;
		// public ImageView iv_8;
		public LinearLayout l_width;
		public ImageView is_praise;// 是否已赞

		// public GridView gv_xinqingpicture;

		// 'humor_trends'心情动态类型
		private String id;// 动态id
		// public String admire;//获赞次数
		// public String discuss;//评论次数
		public TextView collect;// 收藏次数
		public TextView share;// 分享次数
		public String trends_img;// 心情图片路径，多张图片路径用逗号分隔开
		public TextView contents;// 内容
		public String img_url;// 图片网址
		public String video_url;// 视频网址
		public String word_url;// 文字网址
		public TextView addtime;// 发表时间
		// public String delete_hands;//自己 为删除 别的人 举报
		// public String nickName;//发表信息用户昵称
		// public String head;//发表信息用户头像
		// public String uid;//发表信息的用户id
		// public String is_praise;//是否已赞
		public GridView gv_xinqingpicture;// 显示要上传的图片

		// 'activity' 对应的属性（活动）
		public String type;// 类型 用于判断接收返回值是选用的model
		// public String uid;//用户Id
		public TextView start_time;// 开始时间//
		public TextView end_time;// 结束时间

		public TextView start_timeaddend_time;
		public TextView names;// 活动名字
		public TextView typeid;// 活动类型
		public String introduce;// 活动内容简介
		public String gold;// 参加活动所需金额
		public String applied;// 已报名数
		public TextView discuss;// 评论
		public TextView admire;// 赞
		// public String nickName;//用户昵称
		// public String head;//用户头像
		// public String uid;//发表信息的用户id
		// public String delete_hands;//自己 为删除 别的人 举
		public String is_online;// 线上或线下（0：线下，1：线上）
		public TextView address;// 只有活动为线下时 才有此值
		// public String time;//写这条动态的时间
		// private String collect;//收藏次数
		// private String share;//分享次数
		// private String image;//活动代表图
		// 分别是四个 赞，评论，分享，收藏
		public LinearLayout ll_admire, ll_discuss, ll_share;// ll_collect,
		// public String is_praise;//是否已赞
		// 'club' 对应的属性 （俱乐部）

		private TextView nickName;// 用户昵称
		private ImageView head;// 用户头像
		private String uid;// 发表信息的用户id
		private String cid;// 俱乐部id
		private TextView name;// 俱乐部名称
		private ImageView logo;// 俱乐部logo
		private TextView originate_address;// 俱乐部地址
		private TextView price;// 俱乐部加入所需金币
		private Button delete_hands;// 自己 为删除 别的人 举报
		// private String time;
		// private String discuss; //评论
		// private String admire; //赞
		// private String collect; //收藏
		// private String share; //分享
		public TextView typeName;// 俱乐部类型
		public TextView xiangxi;
		// public String is_praise;//是否已赞

		// public LinearLayout ll_admire,ll_dicuss,ll_share;//ll_collect,
		// 评论的
		public ListView listview_pinlun;// 评论的List

		public TextView zanPeople;
		public LinearLayout all_zan_people;
		public ImageView is_collected;

		public ImageView biaoqing;
		public LinearLayout ll_link;
		public TextView xinqinaddress;
		public TextView xinqingaddress;
		public ImageView drop_down;
		public TextView pictureNum;

		private ImageView videoimage;
		private TextView videotitle;
		public LinearLayout videoxianshi;
	}

	/**
	 * 初始化记录视图id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initRecordId(ViewHolder holder) {
		holder.drop_down = (ImageView) this.findViewById(R.id.drop_down);
		// 删除和举报按钮
		holder.delete_hands = (Button) this.findViewById(R.id.delete_hands);
		// 昵称
		holder.nickName = (TextView) this.findViewById(R.id.nickName);
		// 内容
		holder.content = (TextView) this.findViewById(R.id.content);

		// 发表时间
		holder.time = (TextView) this.findViewById(R.id.time);
		// 头像
		holder.head = (ImageView) this.findViewById(R.id.head);
		// 头像
		holder.image = (ImageView) this.findViewById(R.id.image);
		// 活动开始时间和结束时间
		holder.start_timeaddend_time = (TextView) this
				.findViewById(R.id.start_timeaddend_time);
		// 浏览
		holder.view = (TextView) this.findViewById(R.id.view);
		// 评论
		holder.discuss = (TextView) this.findViewById(R.id.discuss);
		// 收藏
		holder.collect = (TextView) this.findViewById(R.id.collect);

		holder.ll_link = (LinearLayout) this.findViewById(R.id.ll_link);

	}

	/**
	 * 显示记录动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void RecordDongtai(ViewHolder holder) {

		holder.ll_link.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(LookAtTheDetailedActivity.this,
						LogReadingActivity.class);
				intent.putExtra("rid", user_trends.getId());
				intent.putExtra("jilu_fabiao_uid", user_trends.getUid());
				startActivity(intent);
			}
		});
		// 删除和举报
		if (user_trends.getDelete_hands() != null) {
			drop(user_trends, holder.drop_down);
		}

		// 昵称
		holder.nickName.setText("" + user_trends.getNickName());
		// 发表时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(
						LookAtTheDetailedActivity.this, user_trends.getTime()));
		// 头像
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {
		}

		//
		// finalBitmap.display(holder.head, Constants.BadiDownImgUrl + "/"
		// + user_trends.getHead());
		// 头
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getImage()
							+ Constants.appPhoto4img, holder.image, options);
		} catch (Exception e) {

		}

		// finalBitmap.display(holder.image, Constants.BadiDownImgUrl + "/"
		// + user_trends.getImage());
		// <<<<<<< .mine
		// // 活动开始时间和结束时间
		// if(user_trends.getStart_time()!=null &&
		// user_trends.getEnd_time()!=null)
		// {
		// String start_time=(user_trends.getStart_time().replaceAll("-",
		// ".")).substring(0, 10);
		// String end_time=(user_trends.getEnd_time().replaceAll("-",
		// ".")).substring(0, 10);
		// holder.start_timeaddend_time.setText(""
		// + start_time + "-"
		// + end_time);
		// }
		// =======
		// 活动开始时间和结束时间
		holder.start_timeaddend_time.setText(""
				+ Utils.Back_Data(user_trends.getStart_time()) + "-"
				+ Utils.Back_Data(user_trends.getEnd_time()));
		// >>>>>>> .r244
		// 浏览
		holder.view.setText("" + user_trends.getView());
		// 评论
		holder.discuss.setText("" + user_trends.getDiscuss());
		// 收藏
		holder.collect.setText("" + user_trends.getCollect());
		holder.content.setText("" + user_trends.getTitle());
		// //缺活动时间
		// //'record' 对应的属性
		// //public String type;//类型 用于判断接收返回值是选用的model
		// public TextView view;//浏览次数
		// //public String discuss;//评论次数
		// //public String collect;//收藏次数
		// //public String id;//该记录的id
		// //public String time;//记录添加时间
		// public ImageView image;//封面图
		// public TextView content;//记录的内容
		// //public String delete_hands;//自己 为删除 别的人 举报
		// //public String nickName;//发表信息用户昵称
		// //private String head//发表信息用户头像
		// //private String uid//发表信息的用户id
		// public String start_time;//开始时间
		// public String end_time;//结束时间
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化俱乐部id
	 * 
	 * @param convertView
	 * @param holder
	 */
	private void initClubId(ViewHolder holder) {
		holder.drop_down = (ImageView) this.findViewById(R.id.drop_down);
		/**
		 * zan
		 */
		holder.is_praise = (ImageView) findViewById(R.id.is_praise);
		// 昵称
		holder.nickName = (TextView) this.findViewById(R.id.nickName);
		// 删除和举报按钮
		holder.delete_hands = (Button) this.findViewById(R.id.delete_hands);
		// 头像
		holder.head = (ImageView) this.findViewById(R.id.head);
		// 发表时间
		holder.time = (TextView) this.findViewById(R.id.time);
		// 俱乐部名
		holder.name = (TextView) this.findViewById(R.id.name);
		// 俱乐部地址
		holder.originate_address = (TextView) this
				.findViewById(R.id.originate_address);
		// 俱乐部种类
		holder.typeName = (TextView) this.findViewById(R.id.typeName);
		// 加入俱乐部需要的金币数量
		holder.price = (TextView) this.findViewById(R.id.price);
		// 获赞次数
		holder.admire = (TextView) this.findViewById(R.id.admire);
		// 评论次数
		holder.discuss = (TextView) this.findViewById(R.id.discuss);
		// 收藏次数
		// holder.collect = (TextView) this.findViewById(R.id.collect);
		// 分享次数
		holder.share = (TextView) this.findViewById(R.id.share);
		// LOGO
		holder.logo = (ImageView) this.findViewById(R.id.logo);
		// 评论
		//
		holder.ll_admire = (LinearLayout) this.findViewById(R.id.ll_admire);
		holder.ll_discuss = (LinearLayout) this.findViewById(R.id.ll_discuss);
		holder.ll_collect = (LinearLayout) this.findViewById(R.id.ll_collect);
		holder.ll_share = (LinearLayout) this.findViewById(R.id.ll_share);
		// public LinearLayout ll_admire,ll_dicuss,ll_share;//ll_collect,
		holder.ll_link = (LinearLayout) this.findViewById(R.id.ll_link);
	}

	/**
	 * 显示创建俱乐部动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void CreateClubDongtai(final ViewHolder holder) {
		holder.ll_link.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(LookAtTheDetailedActivity.this,
						ClubHomepageActivity.class);

				intent.putExtra("cid", user_trends.getCid());
				startActivity(intent);
			}
		});
		// 昵称
		holder.nickName.setText("" + user_trends.getNickName());
		// 是否已经赞过
		if (user_trends.getIs_praise().equals("1")) {
			holder.is_praise.setSelected(true);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

				}
			});

		} else // 0未赞
		{
			holder.is_praise.setSelected(false);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					if (!Utils.getUid(LookAtTheDetailedActivity.this)
							.equals("")) {
						// change_viewHolder = holder;
						// change_imageView=holder.is_praise;
						dianzan(LookAtTheDetailedActivity.this,
								Utils.getUid(LookAtTheDetailedActivity.this),
								user_trends.getId(), user_trends.getUid(),
								user_trends.getType());
					} else {
						Utils.showMessage(LookAtTheDetailedActivity.this,
								getResources().getString(R.string.l_xb10));
					}

				}
			});
		}

		// 删除和举报
		if (user_trends.getDelete_hands() != null) {
			drop(user_trends, holder.drop_down);
		}
		try {
			// 头像
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}

		// 发表时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(
						LookAtTheDetailedActivity.this, user_trends.getTime()));
		// 俱乐部名
		holder.name.setText("" + user_trends.getName());

		// 俱乐部地址
		holder.originate_address.setText(""
				+ user_trends.getOriginate_address());
		// 俱乐部种类
		holder.typeName.setText("" + user_trends.getType_name());

		// 加入俱乐部需要的金币数量
		holder.price.setText("" + user_trends.getPrice());

		// 获赞次数
		holder.admire.setText("" + user_trends.getAdmire());
		// 评论次数
		holder.discuss.setText("" + user_trends.getDiscuss());
		// // 收藏次数
		// holder.collect.setText("" + user_trends.getCollect());
		// 分享次数
		holder.share.setText("" + user_trends.getShare());
		// LOGO
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getLogo()
							+ Constants.appPhoto4img, holder.logo, options);
		} catch (Exception e) {

		}
		// 点击赞
		holder.ll_admire.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				// 收费的
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {
				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}
			}
		});
		// 点击评论
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {

				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}

			}
		});
		// // 点击收藏
		// holder.ll_collect.setOnClickListener(new OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		//
		// }
		// });
		// 分享
		holder.ll_share.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// ShareSDKTools.ShowOneKeyShare(LookAtTheDetailedActivity.this,
				// "分享",
				// Constants.BadiDownImgUrl + "/" + user_trends.getLogo(),
				// "club", user_trends.getId(), user_trends.getUid(),
				// user_trends
				// .getId(), user_trends.getUid(), "0", "club");
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {
					if (!StringUtil.isNullOrEmpty(user_trends.getLogo())) {
						ShareSDKTools.ShowOneKeyShare(
								(LookAtTheDetailedActivity.this), "分享",
								user_trends.getName(), "",
								Constants.BadiDownImgUrl + "/"
										+ Constants.appPhoto4img, "club",
								user_trends.getId(), user_trends.getUid(), "0",
								"club");
					} else {
						ShareSDKTools.ShowOneKeyShare(
								(LookAtTheDetailedActivity.this), "分享",
								user_trends.getName(), "", "", "club",
								user_trends.getId(), user_trends.getUid(), "0",
								"club");
					}
					ShareSDKTools
							.setOnShareFinishCallBack(new ShareSDKTools.CallBack() {

								@Override
								public void ShareFinishCallBack() {
									// TODO Auto-generated method stub
									int a = Integer.parseInt(user_trends
											.getShare());
									user_trends.setShare("" + (a + 1));

									init0();
								}
							});
				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}

			}
		});
		// finalBitmap.display(holder.logo, Constants.BadiDownImgUrl + "/"
		// + user_trends.getLogo());
		// 缺俱乐部类型
		// 赞
		// 评论
		// 分享
		// 收藏

		// //'club' 对应的属性 （俱乐部)
		// private TextView nickName;//用户昵称
		// private ImageView head;//用户头像
		// private String uid;//发表信息的用户id
		// private String cid;//俱乐部id
		// private String name;//俱乐部名称
		// private String logo;//俱乐部logo
		// private String originate_address;//俱乐部地址
		// private String price;//俱乐部加入所需金币
		// private Button delete_hands;//自己 为删除 别的人 举报
		// //private String time;

		// private String discuss; //评论
		// private String admire; //赞
		// private String collect; //收藏
		// private String share; //分享
		// private String typeName;//俱乐部类型
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化上传图片id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initUpPictureId(ViewHolder holder) {
		holder.drop_down = (ImageView) this.findViewById(R.id.drop_down);
		/**
		 * 是否已经赞过了
		 */
		holder.is_praise = (ImageView) this.findViewById(R.id.is_praise);
		holder.head = (ImageView) this.findViewById(R.id.head);
		// 昵称
		holder.nickName = (TextView) this.findViewById(R.id.nickName);
		// 发表时间
		holder.time = (TextView) this.findViewById(R.id.time);
		// 删除和举报按钮
		holder.delete_hands = (Button) this.findViewById(R.id.delete_hands);
		// 获赞次数
		holder.reprint = (TextView) this.findViewById(R.id.reprint);
		// 评论次数
		holder.comment = (TextView) this.findViewById(R.id.comment);
		// 上传图片次数
		holder.img_count = (TextView) this.findViewById(R.id.img_count);
		// 到哪一个相册
		holder.photo_name = (TextView) this.findViewById(R.id.photo_name);
		// 九张小图
		holder.gv_xinqingpicture = (GridView) this
				.findViewById(R.id.xinqingpicture);

		// 用来计算图片的宽
		holder.l_width = (LinearLayout) this.findViewById(R.id.l_width);
		holder.ll_link = (LinearLayout) this.findViewById(R.id.ll_link);
	}

	/**
	 * 显示上传图片动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void UpPictureDongtai(final ViewHolder holder) {
		holder.ll_link.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				if (user_trends.getUid().equals(
						Utils.getUid(LookAtTheDetailedActivity.this))) {
					Intent intent = new Intent(LookAtTheDetailedActivity.this,
							MyPoly1Activity.class);
					startActivity(intent);
				} else {
					Intent intent = new Intent(LookAtTheDetailedActivity.this,
							SeeOtherPeoplePolyActivity.class);
					intent.putExtra("uid", user_trends.getUid());
					startActivity(intent);
				}

			}
		});
		// int w = (int) Utils.GetAssemblyWidth(holder.l_width);
		//

		// 是否已经赞过
		// 是否已经赞过
		if (user_trends.getIs_praise().equals("1")) {
			holder.is_praise.setSelected(true);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

				}
			});

		} else // 0未赞
		{
			holder.is_praise.setSelected(false);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

					dianzan(LookAtTheDetailedActivity.this,
							Utils.getUid(LookAtTheDetailedActivity.this),
							user_trends.getId(), user_trends.getUid(),
							user_trends.getType());

				}
			});
		}
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}

		// 昵称
		holder.nickName.setText("" + user_trends.getNickName());
		// 发表时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(
						LookAtTheDetailedActivity.this, user_trends.getTime()));
		// 删除和举报
		if (user_trends.getDelete_hands() != null) {
			drop(user_trends, holder.drop_down);
		}
		// 获赞次数
		holder.reprint.setText("" + user_trends.getReprint());
		// 评论次数
		holder.comment.setText("" + user_trends.getComment());

		// 上传图片次数
		holder.img_count.setText("" + user_trends.getImg_count());
		// 到哪一个相册
		holder.photo_name.setText("" + user_trends.getPhoto_name());

		// int wh = (w / 3 - 2);

		// 图片的
		if (user_trends.getImg() != null) {
			holder.gv_xinqingpicture.setVisibility(View.VISIBLE);
			String[] img = new String[user_trends.getImg().size()];
			for (int i = 0; i < user_trends.getImg().size(); i++) {
				img[i] = user_trends.getImg().get(i).getPath();
			}
			GridViewSHUZHUAdapter shuzhuAdapter = new GridViewSHUZHUAdapter(
					LookAtTheDetailedActivity.this, img);
			holder.gv_xinqingpicture.setAdapter(shuzhuAdapter);
			holder.gv_xinqingpicture
					.setOnItemClickListener(new AdapterView.OnItemClickListener() {

						@Override
						public void onItemClick(AdapterView<?> arg0, View view,
								int position, long arg3) {
							// TODO Auto-generated method stub
							// user_trends.get(pos).getImg().get(position).getPath();

							Intent intent = new Intent(
									LookAtTheDetailedActivity.this,
									PicturePreviewActivity.class);
							List<BrowseAllPhoto_Model> ll = new ArrayList<BrowseAllPhoto_Model>();
							for (int i = 0; i < user_trends.getImg().size(); i++) {
								BrowseAllPhoto_Model bm = new BrowseAllPhoto_Model();
								bm.setId(user_trends.getImg().get(i).getId());
								bm.setPath(user_trends.getImg().get(i)
										.getPath());
								ll.add(bm);
							}
							intent.putExtra("picture_list", (Serializable) ll);
							intent.putExtra("picture_postion", position);
							startActivity(intent);

						}
					});
		} else {
			holder.gv_xinqingpicture.setVisibility(View.GONE);
		}

	}

	// TODO Auto-generated method stub
	/**
	 * 初始化心情动态id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initDongTaiId(ViewHolder holder) {
		holder.drop_down = (ImageView) this.findViewById(R.id.drop_down);
		holder.is_collected = (ImageView) this.findViewById(R.id.is_collected);
		// 显示上传的图片
		holder.gv_xinqingpicture = (GridView) this
				.findViewById(R.id.xinqingpicture);
		/**
		 * 是否已经赞过了
		 */
		holder.is_praise = (ImageView) this.findViewById(R.id.is_praise);
		//
		// 详细
		holder.xiangxi = (TextView) this.findViewById(R.id.xiangxi);
		//
		// 昵称
		holder.nickName = (TextView) this.findViewById(R.id.nickName);
		//
		// 头像
		holder.head = (ImageView) this.findViewById(R.id.head);
		//
		// 昵称
		holder.addtime = (TextView) this.findViewById(R.id.addtime);
		//
		// 内容
		holder.contents = (TextView) this.findViewById(R.id.contents);
		// // 删除和举报按钮
		// holder.delete_hands = (Button) this.findViewById(R.id.delete_hands);
		//
		// 地点
		holder.address = (TextView) this.findViewById(R.id.address);
		// 获赞次数
		holder.admire = (TextView) this.findViewById(R.id.admire);
		// 评论次数
		holder.discuss = (TextView) this.findViewById(R.id.discuss);
		// 发表时间
		holder.addtime = (TextView) this.findViewById(R.id.addtime);
		// 收藏次数
		holder.collect = (TextView) this.findViewById(R.id.collect);
		// 分享次数
		holder.share = (TextView) this.findViewById(R.id.share);
		holder.xinqinaddress = (TextView) this.findViewById(R.id.xinqinaddress);
		//
		holder.ll_admire = (LinearLayout) this.findViewById(R.id.ll_admire);
		holder.ll_discuss = (LinearLayout) this.findViewById(R.id.ll_discuss);
		holder.ll_collect = (LinearLayout) this.findViewById(R.id.ll_collect);
		holder.ll_share = (LinearLayout) this.findViewById(R.id.ll_share);
		holder.xinqingaddress = (TextView) this
				.findViewById(R.id.xinqinaddress);
		holder.pictureNum = (TextView) this.findViewById(R.id.pictureNum);
		holder.videoimage = (ImageView) this.findViewById(R.id.videoimage);
		holder.videotitle = (TextView) this.findViewById(R.id.videotitle);
		holder.videoxianshi = (LinearLayout) this
				.findViewById(R.id.videoxianshi);
	}

	/**
	 * 显示心情动态
	 * 
	 * @param convertView
	 * @param holder
	 * @param pos
	 */
	public void XinQingDongtai(ViewHolder holder) {
		holder.pictureNum.setVisibility(View.GONE);
		// 心情动态图片显示","隔开
		if (user_trends != null)
			if (!StringUtil.isNullOrEmpty(user_trends.getTrends_img())) {

				holder.gv_xinqingpicture.setVisibility(View.VISIBLE);
				String xinqingtupians = user_trends.getTrends_img();
				String xinqingids = user_trends.getImgIdStr();
				String[] xinqingtupian = xinqingtupians.split(",");
				String[] xinqingid = xinqingids.split(",");
				if (xinqingid.length > 9) {
					holder.pictureNum.setVisibility(View.VISIBLE);
					String a = String.format(
							getResources().getString(R.string.wx2_13), ""
									+ xinqingid.length);
					holder.pictureNum.setText(a);
				} else {
					holder.pictureNum.setVisibility(View.GONE);
				}

				final GridViewSHUZHUAdapter adapter = new GridViewSHUZHUAdapter(
						LookAtTheDetailedActivity.this, xinqingtupian,
						xinqingid);
				holder.gv_xinqingpicture.setAdapter(adapter);
				holder.gv_xinqingpicture
						.setOnItemClickListener(new OnItemClickListener() {

							@Override
							public void onItemClick(AdapterView<?> arg0,
									View arg1, int position, long arg3) {
								// TODO Auto-generated method stub
								Intent intent = new Intent(
										LookAtTheDetailedActivity.this,
										PicturePreviewActivity.class);
								intent.putExtra("picture_list",
										(Serializable) adapter
												.getBrowseAllPhoto_Model());
								intent.putExtra("picture_postion", position);
								startActivity(intent);
							}
						});

				if (xinqingtupian[0] != null)
					ShareImage = xinqingtupian[0];
			} else {
				holder.gv_xinqingpicture.setVisibility(View.GONE);
			}
		try {
			// 是否已经赞过
			if (user_trends.getIs_praise().equals("1")) {
				holder.is_praise.setSelected(true);
				holder.is_praise.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {
						if (!Utils.getUid(LookAtTheDetailedActivity.this)
								.equals("")) {
						} else {
							Utils.showMessage(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb10));
						}

					}
				});

			} else // 0未赞
			{
				holder.is_praise.setSelected(false);
				holder.is_praise.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {

						// change_imageView=holder.is_praise;
						if (!Utils.getUid(LookAtTheDetailedActivity.this)
								.equals("")) {
							dianzan(LookAtTheDetailedActivity.this, Utils
									.getUid(LookAtTheDetailedActivity.this),
									user_trends.getId(), user_trends.getUid(),
									user_trends.getType());
						} else {
							Utils.showMessage(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb10));
						}

					}
				});
			}
		} catch (Exception e) {
			// TODO: handle exception
		}

		// 点击头像后头像进入到资料
		if (!Utils.getUid(LookAtTheDetailedActivity.this).equals(
				user_trends.getUid())) {
			holder.head.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					// ((AfterLandingActivity)
					// LookAtTheDetailedActivity.this).jiazai(11);
				}
			});
		} else {
			holder.head.setOnClickListener(new View.OnClickListener() {
				@Override
				public void onClick(View v) {

				}
			});
		}
		try {
			if (user_trends.getVideo_str() != null) {

				holder.videoxianshi.setVisibility(View.VISIBLE);
				ImageLoader.getInstance().displayImage(

				user_trends.getVideo_str().getImg().getLarge(),
						holder.videoimage, options);
				holder.videotitle.setText(""
						+ user_trends.getVideo_str().getTitle());
				holder.videoxianshi.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {

						// 跳转网页

						Uri uri = Uri.parse(user_trends.getVideo_str()
								.getUrl());
						Intent intent = new Intent(Intent.ACTION_VIEW, uri);
						startActivity(intent);

					}
				});

			} else {

				holder.videoxianshi.setVisibility(View.GONE);
			}

		} catch (Exception e) {

		}
		// 头像
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}

		// finalBitmap.display(holder.head, Constants.BadiDownImgUrl + "/"
		// + user_trends.getHead());
		// 昵称
		holder.nickName.setText("" + user_trends.getNickName());

		// 点击内容后进入到资料
		if (!Utils.getUid(LookAtTheDetailedActivity.this).equals(
				user_trends.getUid())) {
			holder.contents.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {

					// ((AfterLandingActivity)
					// LookAtTheDetailedActivity.this).jiazai(11);
				}
			});
		} else {
			holder.contents.setOnClickListener(new View.OnClickListener() {
				@Override
				public void onClick(View v) {

				}
			});
		}
		// 下面来判断内容太长了的时候
		if (user_trends.getContents() != null) {
			// 内容
			// holder.contents
			// .setText("" + user_trends.get(pos).getContents());
			new HtmlUtils(LookAtTheDetailedActivity.this, holder.contents,
					user_trends.getContents()).showTextView();
			if (ShowSuoQi == true) {
				holder.xiangxi.setVisibility(View.VISIBLE);
				holder.xiangxi.setText("<<"
						+ getResources().getString(R.string.l_xb87));
				holder.xiangxi.setOnClickListener(new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						finish();
					}
				});
			} else {

				holder.xiangxi.setVisibility(View.GONE);
			}

		}
		// 发表时间
		holder.addtime.setText(""
				+ CalendarTools.getTimeChangeToString(
						LookAtTheDetailedActivity.this,
						user_trends.getAddtime()));
		// 删除和举报按钮
		// 删除和举报
		if (user_trends.getDelete_hands() != null) {
			drop(user_trends, holder.drop_down);
		} else if (user_trends.getIs_status() != null) {

			drop(user_trends, holder.drop_down);

		}

		if (user_trends.getIs_status() != null) {
			if (user_trends.getIs_status().equals("1")) {
				//
				// holder.delete_hands.setText(""
				// + getResources().getString(R.string.Delete));
				// holder.delete_hands
				// .setOnClickListener(new View.OnClickListener() {
				//
				// @Override
				// public void onClick(View v) {
				// // TODO Auto-generated method stub
				//
				// Dialog dialog = new Dialog();
				// dialog.CreateDialog(
				// LookAtTheDetailedActivity.this,
				// getResources().getString(
				// R.string.l_xb88),
				// getResources().getString(
				// R.string.l_xb89));
				// dialog.setOnDialogClistener(new Dialog.DialogClistener() {
				//
				// @Override
				// public void ret() {
				// // TODO Auto-generated method stub
				//
				// }
				//
				// @Override
				// public void ok() {
				// // TODO Auto-generated method stub
				// deleteDongTai(user_trends.getTrendsId());
				// }
				// });
				// }
				// });

			} else if (user_trends.getIs_status().equals("0")) {
				// holder.delete_hands.setText(getResources().getString(
				// R.string.Inform));
				// jubao(user_trends.getUid(), user_trends.getType(),
				// user_trends.getId());
				// 就是举报
			}
		}
		// 获赞次数
		holder.admire.setText("" + user_trends.getAdmire());
		// 评论次数
		holder.discuss.setText("" + user_trends.getDiscuss());
		// 收藏次数
		holder.collect.setText("" + user_trends.getCollect());
		// 分享次数
		holder.share.setText("" + user_trends.getShare());

		// 点击赞
		holder.ll_admire.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				// 收费的
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {
				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}
			}
		});
		// 点击评论
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {
				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}

			}
		});
		// 点击收藏
		if (user_trends.getIs_collected() == 1) {
			holder.is_collected.setSelected(true);
			holder.is_collected.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					if (!Utils.getUid(LookAtTheDetailedActivity.this)
							.equals("")) {
					} else {
						Utils.showMessage(LookAtTheDetailedActivity.this,
								getResources().getString(R.string.l_xb10));
					}

				}
			});
		} else {
			holder.is_collected.setSelected(false);
			holder.is_collected.setOnClickListener(new View.OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub

					if (!Utils.getUid(LookAtTheDetailedActivity.this)
							.equals("")) {
						collect(cid, user_trends.getUid(), user_trends.getId(),
								user_trends.getType());
					} else {
						Utils.showMessage(LookAtTheDetailedActivity.this,
								getResources().getString(R.string.l_xb10));
					}

				}
			});
		}
		// 分享
		holder.ll_share.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				String xinqingtupians = user_trends.getTrends_img();
				String[] xinqingtupian = xinqingtupians.split(",");
				String ShareImage = xinqingtupian[0];
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {
					if (!StringUtil.isNullOrEmpty(ShareImage)) {
						ShareSDKTools.ShowOneKeyShare(
								LookAtTheDetailedActivity.this, "分享",
								user_trends.getContents(), "",
								Constants.BadiDownImgUrl + "/" + ShareImage,
								"humor_trends", user_trends.getId(),
								user_trends.getUid(), "0", "humor_trends");
					} else {
						ShareSDKTools.ShowOneKeyShare(
								LookAtTheDetailedActivity.this, "分享",
								user_trends.getContents(), "",
								Constants.BadiDownImgUrl + "/" + ShareImage,
								"humor_trends", user_trends.getId(),
								user_trends.getUid(), "0", "humor_trends");
					}
					// ShareSDKTools.ShowOneKeyShare(LookAtTheDetailedActivity.this,
					// "分享", user_trends.getContents(), "",
					// Constants.BadiDownImgUrl + "/" + ShareImage,
					// "humor_trends", user_trends.getId(),
					// user_trends.getUid(), "0", "humor_trends");
					ShareSDKTools
							.setOnShareFinishCallBack(new ShareSDKTools.CallBack() {

								@Override
								public void ShareFinishCallBack() {
									// TODO Auto-generated method stub
									int a = Integer.parseInt(user_trends
											.getShare());
									user_trends.setShare("" + (a + 1));

									init0();
								}
							});
				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}

			}
		});

		// 地址
		holder.xinqingaddress.setVisibility(View.VISIBLE);
		if (user_trends.getAddress() != null) {
			holder.xinqingaddress.setText("" + user_trends.getAddress());
			holder.xinqingaddress.setVisibility(View.VISIBLE);
		} else {
			holder.xinqingaddress.setVisibility(View.GONE);
		}
	}

	// TODO Auto-generated method stub
	/**
	 * 初始化活动id
	 * 
	 * @param convertView
	 * @param holder
	 */
	public void initActivityId(ViewHolder holder) {
		holder.drop_down = (ImageView) this.findViewById(R.id.drop_down);
		/**
		 * 是否已经赞过了
		 */
		holder.is_praise = (ImageView) this.findViewById(R.id.is_praise);
		// 头像
		holder.head = (ImageView) this.findViewById(R.id.head);
		// 昵称
		holder.nickName = (TextView) this.findViewById(R.id.nickName);
		// 昵称
		holder.time = (TextView) this.findViewById(R.id.time);
		// 活动名称
		holder.names = (TextView) this.findViewById(R.id.names);
		// 活动开始时间和结束时间
		holder.start_timeaddend_time = (TextView) this
				.findViewById(R.id.start_timeaddend_time);
		// 删除和举报按钮
		holder.delete_hands = (Button) this.findViewById(R.id.delete_hands);
		// 地点
		holder.address = (TextView) this.findViewById(R.id.address);
		// 活动类型
		holder.typeid = (TextView) this.findViewById(R.id.typeid);
		// 获赞次数
		holder.admire = (TextView) this.findViewById(R.id.admire);
		// 评论次数
		holder.discuss = (TextView) this.findViewById(R.id.discuss);
		// 收藏次数
		holder.collect = (TextView) this.findViewById(R.id.collect);
		// 分享次数
		holder.share = (TextView) this.findViewById(R.id.share);
		holder.image = (ImageView) this.findViewById(R.id.image);

		//
		holder.ll_admire = (LinearLayout) this.findViewById(R.id.ll_admire);
		holder.ll_discuss = (LinearLayout) this.findViewById(R.id.ll_discuss);
		holder.ll_collect = (LinearLayout) this.findViewById(R.id.ll_collect);
		holder.ll_share = (LinearLayout) this.findViewById(R.id.ll_share);
		holder.ll_link = (LinearLayout) this.findViewById(R.id.ll_link);

	};

	/**
	 * 显示 发活动动态
	 * 
	 * @param this
	 * @param holder
	 * @param pos
	 */
	public void PostActivityDongtai(ViewHolder holder) {
		holder.ll_link.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(LookAtTheDetailedActivity.this,
						ActivityReadingActivity.class);
				intent.putExtra("actId", user_trends.getId());

				// 地点
				if (user_trends.getIs_online().equals("0")) {
					intent.putExtra("isOnLine", false);
				} else {
					intent.putExtra("isOnLine", true);
					// holder.address.setText("线上主题");//
					// LookAtTheDetailedActivity.this.getResources().getString(R.string.OnlineTheme)
				}

				startActivity(intent);
			}
		});
		// 是否已经赞过
		if (user_trends.getIs_praise().equals("1")) {
			holder.is_praise.setSelected(true);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					if (!Utils.getUid(LookAtTheDetailedActivity.this)
							.equals("")) {

					} else {
						Utils.showMessage(LookAtTheDetailedActivity.this,
								getResources().getString(R.string.l_xb10));
					}

				}
			});

		} else // 0未赞
		{
			holder.is_praise.setSelected(false);
			holder.is_praise.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

					// change_imageView=holder.is_praise;
					// change_text=holder.admire;
					if (!Utils.getUid(LookAtTheDetailedActivity.this)
							.equals("")) {
						dianzan(LookAtTheDetailedActivity.this,
								Utils.getUid(LookAtTheDetailedActivity.this),
								user_trends.getId(), user_trends.getUid(),
								user_trends.getType());
					} else {
						Utils.showMessage(LookAtTheDetailedActivity.this,
								getResources().getString(R.string.l_xb10));
					}

				}
			});
		}
		// 头像
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getHead()
							+ Constants.appPhoto4img, holder.head, options);
		} catch (Exception e) {

		}
		// 昵称
		holder.nickName.setText("" + user_trends.getNickName());
		// 时间
		holder.time.setText(""
				+ CalendarTools.getTimeChangeToString(
						LookAtTheDetailedActivity.this, user_trends.getTime()));

		// 活动名称
		holder.names.setText("" + user_trends.getNames());
		// 活动开始时间和结束时间
		holder.start_timeaddend_time.setText(""
				+ Utils.Back_Data(user_trends.getStart_time()) + "-"
				+ Utils.Back_Data(user_trends.getEnd_time()));
		// 删除和举报按钮
		// 删除和举报
		if (user_trends.getDelete_hands() != null) {
			drop(user_trends, holder.drop_down);
		}

		//
		if (user_trends.getIs_online() != null) {
			// 地点
			if (user_trends.getIs_online().equals("0")) {
				holder.address.setText("" + user_trends.getAddress());
			} else {
				holder.address.setText(""
						+ getResources().getString(R.string.OnlineTheme));// LookAtTheDetailedActivity.this.getResources().getString(R.string.OnlineTheme)
			}
		}
		if (user_trends.getTypeid() != null) {
			holder.typeid.setText("" + user_trends.getTypeid().getName());
		} else {
			// 活动类型
			holder.typeid.setText("" + user_trends.getType_name());
		}

		// 获赞次数
		holder.admire.setText("" + user_trends.getAdmire());
		// 评论次数
		holder.discuss.setText("" + user_trends.getDiscuss());
		// 收藏次数
		holder.collect.setText("" + user_trends.getCollect());
		// 分享次数
		holder.share.setText("" + user_trends.getShare());
		try {
			ImageLoader.getInstance().displayImage(
					Constants.BadiDownImgUrl + "/" + user_trends.getImage()
							+ Constants.appPhoto4img, holder.image, options);
		} catch (Exception e) {

		}
		// 点击赞
		holder.ll_admire.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {

				// 收费的
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {

				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}
			}
		});
		// 点击评论
		holder.ll_discuss.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {

				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}
			}
		});
		// 点击收藏
		holder.ll_collect.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {

				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}
			}
		});
		// 分享
		holder.ll_share.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				if (!Utils.getUid(LookAtTheDetailedActivity.this).equals("")) {
					if (!StringUtil.isNullOrEmpty(user_trends.getImage())) {
						ShareSDKTools.ShowOneKeyShare(
								LookAtTheDetailedActivity.this,
								"分享",
								user_trends.getNames(),
								"",
								Constants.BadiDownImgUrl + "/"
										+ user_trends.getImage(), "activity",
								user_trends.getId(), user_trends.getUid(), cid,
								"activity");
					} else {
						ShareSDKTools.ShowOneKeyShare(
								LookAtTheDetailedActivity.this, "分享",
								user_trends.getNames(), "", "", "activity",
								user_trends.getId(), user_trends.getUid(), cid,
								"activity");
					}

					ShareSDKTools
							.setOnShareFinishCallBack(new ShareSDKTools.CallBack() {

								@Override
								public void ShareFinishCallBack() {
									// TODO Auto-generated method stub
									int a = Integer.parseInt(user_trends
											.getShare());
									user_trends.setShare("" + (a + 1));

									init0();
								}
							});
				} else {
					Utils.showMessage(LookAtTheDetailedActivity.this,
							getResources().getString(R.string.l_xb10));
				}
			}
		});
		//

	}

	/**
	 * 删除动态 动态的id
	 */
	public void deleteDongTai(String id) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("uid", Utils.getUid(LookAtTheDetailedActivity.this));
		map.put("trendsId", id);
		CommonUtils.CommomPostfunction(LookAtTheDetailedActivity.this,
				Constants.BadiUrl_1 + "commonality/deleteTrends", map, handler,
				1, 9, 7, 8);
	}

	/**
	 * 举报 被举报人的id 举报类行
	 * 
	 * @param bei_person_id
	 *            被举报人id
	 * @param table
	 *            举报类型humor_trends：心情动态，photo：相册，record：记录（篇），record_article：记录（
	 *            记），activity：活动，club：俱乐部，discuss：评论
	 * @param bei_neirong_id
	 *            举报的内容id
	 */
	public void jubao(String bei_person_id, String table, String bei_neirong_id) {
		Intent intent = new Intent(LookAtTheDetailedActivity.this,
				InformActivity.class);
		intent.putExtra("bei_person_id", bei_person_id);
		intent.putExtra("table", table);
		intent.putExtra("bei_neirong_id", bei_neirong_id);
		intent.putExtra("bei_cid", "0");
		startActivity(intent);
	}

	/**
	 * 点赞 接口名称 praise_operate 用户的点赞人的id 提交方式$GET
	 * 
	 * @param $uid
	 *            ;//点赞人的id
	 * @param $nid
	 *            ;//被操作内容的Id
	 * @param $nuid
	 *            ;//内容所属人id
	 * @param $type赞的类型
	 *            （record_article，club，humor_trends，photo，activity）
	 * @param hander
	 *            ;
	 * @param Success
	 *            ;成功
	 * @param defalt
	 *            ;失败
	 */
	public void dianzan(final Context context, final String uid,
			final String nid, final String nuid, final String type) {
		Utils.showPrgress(context);
		MyThreadTool.fixedThreadPool.execute(new Runnable() {

			@Override
			public void run() {

				String content = Utils.getRequest(Constants.BadiUrl
						+ "praise_operate?uid=" + uid + "&nid=" + nid
						+ "&nuid=" + nuid + "&type=" + type);
				//
				// + "type=" + type);
				// ("数据是：" + content);
				if (content != null) {
					// ("数据是：" + content);
					Results results = Utils.checkResult_NNN(context, content);
					if (results != null && !results.getRetmsg().equals("null")) {
						//
						try {
							Message msg = new Message();
							msg.what = 5;

							handler.sendMessage(msg);
						} catch (Exception e) {

						}
					} else {
						handler.sendEmptyMessage(1);
					}
				} else {
					handler.sendEmptyMessage(1);
				}
			}
		});

	}

	/**
	 * 查看某个动态的评论列表---get(必需--配合语言)
	 * 
	 * @param $id
	 *            //(必需)需要查看的动态评论ID
	 * @param $type
	 *            //(必需)动态的类型---photo_img：图片，photo：相册，record_article：记录（记），
	 *            humor_trends:心情动态，club：俱乐部，activity：活动
	 * @param $disNum
	 *            //显示的一级评论数量
	 * @param $l
	 *            ;（必需）//zh-cn 为中文简体，zh-tw 中文繁体 en-us 英文
	 */
	private void ShowDisscuss(final String id, final String type,
			final String disNum, String l) {
		Utils.showPrgress(LookAtTheDetailedActivity.this);
		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				Map<String, Object> map = new HashMap<String, Object>();

				// String content = Utils.sendRequest(map, Constants.BadiUrl
				// + "friends");
				String l = Dialog
						.getSystemLanguageTypegy(LookAtTheDetailedActivity.this);
				String content = Utils.getRequest(Constants.BadiUrl_1
						+ "commonality/showDisscuss?id=" + id + "&type=" + type
						+ "&disNum=" + disNum + "&l=" + l);
				// ();
				// + "&page=" + page + "&pageNum=" + 10);
				//
				if (content != null) {
					Results results = Utils.checkResult_NNN(
							LookAtTheDetailedActivity.this, content);
					if (results != null && !results.getRetmsg().equals("null")
							&& results.isRet() == true) {
						//
						try {
							discuss = JsonUtil.getEntityByJsonString(
									results.getRetmsg(), Discuss.class);
							// showDisscuss=discuss.getDiscu().get(0);
							// activityReadingModel=JsonUtil.getEntityByJsonString(results.getRetmsg(),
							// ActivityReadingModel.class);
							handler.sendEmptyMessage(4);
						} catch (Exception e) {

						}
					} else {
						handler.sendEmptyMessage(3);
					}
				} else {

					handler.sendEmptyMessage(1);
				}
			}
		});
	}

	/*
	 * 用户赞列表---POST
	 * 
	 * @param $type 赞的类型 humor_trends：心情动态 photo：相册 photo_img：图片
	 * record_article：记录（记） activity：活动 club：俱乐部
	 * 
	 * @param $contentId 被赞的内容ID
	 */
	private void praiseList(final String type, final String contentId) {

		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("type", type);
				map.put("contentId", contentId);
				String content = null;

				content = Utils.sendRequest(map, Constants.BadiUrl_1
						+ "commonality/praiseList");
				//
				if (content != null) {
					Results results = Utils.checkResult_NNN(
							LookAtTheDetailedActivity.this, content);

					//

					if (results != null && !results.getRetmsg().equals("null")) {
						try {

							user = JSONUtils.getListByJsonString(
									results.getRetmsg(), User.class);
							handler.sendEmptyMessage(2);
						} catch (Exception e) {

							handler.sendEmptyMessage(2);
						}
					} else {

						handler.sendEmptyMessage(3);
					}
				} else {

					handler.sendEmptyMessage(1);
				}
			}
		});
	}

	public void sendMessage() {
		sendMessage(Utils.getUid(LookAtTheDetailedActivity.this),
				user_trends.getUid(), user_trends.getId(),
				user_trends.getType(), holder.send_content.getText().toString()
						.trim());

	}

	/**
	 * 用户评论使用接口 提交方式GET
	 * 
	 * @param $uid
	 *            ;//评论者的id @param $buid;//被评论者的id
	 * @param $conId
	 *            ;//被评论的内容id @param $type ;// 被评论类型activity club humor_trends
	 *            photo photo_img record_article
	 * @param $content
	 *            ;//评论内容
	 */
	public void sendMessage(final String uid, final String buid,
			final String conId, final String type, final String contents) {
		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				//
				// + conId + "&type=" + type + "&content=" + contents);
				String content = Utils.getRequest(Constants.BadiUrl
						+ "user_discuss?uid=" + uid + "&buid=" + buid
						+ "&conId=" + conId + "&type=" + type + "&content="
						+ contents);

				if (content != null) {
					// ("数据是：" + content);
					Results results = Utils.checkResult_NNN(
							LookAtTheDetailedActivity.this, content);
					if (results != null && !results.getRetmsg().equals("null")) {
						//
						try {

							if (results.isRet() == true) {
								handler.sendEmptyMessage(10);
							} else {
								handler.sendEmptyMessage(11);
							}
						} catch (Exception e) {
							// TODO Auto-generated catch block

						}
					} else {
						handler.sendEmptyMessage(3);
					}
				} else {
					handler.sendEmptyMessage(1);
				}

			}
		});
	}

	/**
	 * 
	 * @param nuid
	 *            //被收藏内容所属的用户id
	 * @param neirong_id
	 *            /被收藏的内容id
	 * @param type
	 *            被收藏的类型 （photo_img，record，humor_trends）
	 */
	public void collect(String cid, String nuid, String neirong_id, String type) {// Constants.BadiUrl+
																					// "praise_operate?uid="+uid+"&nid="+nid+"&nuid="+nuid+"&type="+type
		/*
		 * 用户收藏的操作接口 提交方式GET
		 * 
		 * @param $uid;//收藏人的id @param $nuid;//被收藏内容所属的用户id
		 * 
		 * @param $nid;//被收藏的内容id @param
		 * $type;//被收藏的类型（photo_img，record，humor_trends）
		 */
		String uid = Utils.getUid(LookAtTheDetailedActivity.this);

		CommonUtils.CommomGetfunction(LookAtTheDetailedActivity.this,
				Constants.BadiUrl + "collect_operate?uid=" + uid + "&cid="
						+ cid + "&nuid=" + nuid + "&nid=" + neirong_id
						+ "&type=" + type, handler, 1, 9, 12, 13);
	}

	public void getSend_Content(getEditText get) {
		get.getEditText(holder.send_content);

	}

	public interface getEditText {
		void getEditText(EditText send_content);
	}

	@Override
	protected void onActivityResult(int arg0, int arg1, Intent arg2) {
		// TODO Auto-generated method stub
		super.onActivityResult(arg0, arg1, arg2);

		if (arg0 == gerenbiaoqing
				&& arg1 == SinaExpressionActivity.ACTIVITY_BIAOQING) {
			if (arg2 != null) {
				// String con = arg2.getExtras().getString("result");
				// String con1 = chat.getText().toString();
				// String con2 = con1 + con;
				// chat.setText(con2);
				String content2 = arg2.getStringExtra("result");
				int index = holder.send_content.getSelectionStart();
				Editable edit = holder.send_content.getEditableText();
				edit.insert(index, content2);

			}

		}

	}

	public void drop(final User_trends_Model user_trends, ImageView drop) {

		LayoutInflater inflater = LayoutInflater
				.from(LookAtTheDetailedActivity.this);
		View root = inflater.inflate(R.layout.drop_down, null);

		TextView delete_hands = (TextView) root.findViewById(R.id.delete_hands);
		if (user_trends.getDelete_hands() != null) {
			delete_hands.setText("" + user_trends.getDelete_hands());
			if (user_trends.getDelete_hands().equals(
					getResources().getString(R.string.Delete))) {
				delete_hands.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View v) {
						if (!Utils.getUid(LookAtTheDetailedActivity.this)
								.equals("")) {
							Dialog dialog = new Dialog();
							dialog.CreateDialog(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb88),
									getResources().getString(R.string.l_xb89));
							dialog.setOnDialogClistener(new Dialog.DialogClistener() {

								@Override
								public void ret() {
									// TODO Auto-generated method stub

								}

								@Override
								public void ok() {
									// TODO Auto-generated method stub
									deleteDongTai(user_trends.getTrendsId());
								}
							});
						} else {
							Utils.showMessage(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb10));
						}
					}
				});
			} else {
				delete_hands.setOnClickListener(new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						if (!Utils.getUid(LookAtTheDetailedActivity.this)
								.equals("")) {
							jubao(user_trends.getUid(), user_trends.getType(),
									user_trends.getId());
						} else {
							Utils.showMessage(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb10));
						}
						// 就是举报
					}
				});
			}
		} else if (user_trends.getIs_status() != null) {
			if (user_trends.getIs_status().equals("1")) {
				delete_hands.setText(""
						+ getResources().getString(R.string.Delete));
				delete_hands.setOnClickListener(new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						if (!Utils.getUid(LookAtTheDetailedActivity.this)
								.equals("")) {
							Dialog dialog = new Dialog();
							dialog.CreateDialog(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb88),
									getResources().getString(R.string.l_xb89));
							dialog.setOnDialogClistener(new Dialog.DialogClistener() {

								@Override
								public void ret() {
									// TODO Auto-generated method stub

								}

								@Override
								public void ok() {
									// TODO Auto-generated method stub
									deleteDongTai(user_trends.getTrendsId());
								}
							});
						} else {
							Utils.showMessage(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb10));
						}
					}
				});
			} else if (user_trends.getIs_status().equals("2")) {
				delete_hands.setText(getResources().getString(R.string.Inform));
				delete_hands.setOnClickListener(new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						if (!Utils.getUid(LookAtTheDetailedActivity.this)
								.equals("")) {
							jubao(user_trends.getUid(), user_trends.getType(),
									user_trends.getId());
						} else {
							Utils.showMessage(LookAtTheDetailedActivity.this,
									getResources().getString(R.string.l_xb10));
						}

					}
				});
			}
		}

		PopWindowUtils
				.showPopWindow(LookAtTheDetailedActivity.this, root, drop);

		// // 删除和举报按钮
		// holder.delete_hands
		// .setText("" + user_trends.get(pos).getDelete_hands());
		// if (user_trends.get(pos).getDelete_hands().equals("删除")) {
		// holder.delete_hands.setOnClickListener(new View.OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// // TODO Auto-generated method stub
		//
		// Dialog dialog = new Dialog();
		// dialog.CreateDialog(getActivity(), "删除动态？", "是否删除该动态？");
		// dialog.setOnDialogClistener(new Dialog.DialogClistener() {
		//
		// @Override
		// public void ret() {
		// // TODO Auto-generated method stub
		// }
		//
		// @Override
		// public void ok() {
		// // TODO Auto-generated method stub
		// delete_where_dongtai = pos;
		// deleteDongTai(user_trends.get(pos).getTrendsId());
		// }
		// });
		// }
		// });
		//
		// } else {
		// holder.delete_hands.setOnClickListener(new View.OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// // TODO Auto-generated method stub
		// jubao(user_trends.get(pos).getUid(), user_trends.get(pos)
		// .getType(), user_trends.get(pos).getId());
		// // 就是举报
		// }
		// });
		// }
	}
}
